package com.agrm.rabc.mapper;

import com.agrm.model.rabc.dto.Resource;
import com.agrm.model.rabc.pojo.ResourceSearchBean;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;

@Mapper
public interface ResourceDao extends BaseMapper<Resource> {
    default Page<Resource> findAll(ResourceSearchBean rsb, Page<Resource> page) {
        LambdaQueryWrapper<Resource> qw = Wrappers.lambdaQuery(rsb);
        return selectPage(page, qw);
    }
}
